home *** CD-ROM | disk | FTP | other *** search
/ What CD? 12 / What PC June 1997.iso / multi / cyber / cyber95 / _setup.1 / RIBHORN4.POP < prev    next >
Encoding:
Text File  |  1996-09-02  |  6.1 KB  |  208 lines

  1. // file : ribHorn4.pop
  2. // the ribHorn form has the same top level structure as a normal horn form,
  3. // but it's ribs are made up of reflected sub-horns.
  4. // this form modifies ribHorn3 by removing some of the movement variability
  5.  
  6.  
  7. /////////////////////////////////
  8. // population display settings //
  9. /////////////////////////////////
  10.  
  11. population 0
  12. dimensions = 1
  13. colour_model RGB
  14. render_quality flat
  15.  
  16.  
  17. ////////////
  18. // genome //
  19. ////////////
  20.  
  21. genome 0 {
  22.  
  23.     ////////////////
  24.     // initialise //
  25.     ////////////////
  26.  
  27.     // initialise scaling
  28.     eggScale( 1 : 0.5 : 1 ),   // allow smaller primitives than standard
  29.     ratio( .2 : .1 : 1 ),
  30.  
  31.     // initialise material properties
  32.     setColour( hsv<.5,.5,.75> : hsv<0,.2,.5> : hsv<.99999,.99999,.99999> ),
  33.     setTexture( norder false:toggle ),
  34.     setBitmap( norder 0 : 0 : 20 ),
  35.     *setWrap( norder 0 : 0 : 2 ),
  36.  
  37.     ///////////////
  38.     // horn loop //
  39.     ///////////////
  40.  
  41.     for( 2 : 2 : 40,  0,   // mem[0] = #horn-segments
  42.  
  43.         // horn-segment code is made up of 2 distinct code blocks; the first block is executed
  44.         // within a new scope, called the "segment rib"; the second block is executed within
  45.         // the current scope and is called the "segment spine"
  46.         join(
  47.  
  48.             // mem[1] = mem[0] % 2
  49.             setScalarMem( 1, frac(div(getScalarMem(0),2)) ),
  50.             
  51.             /////////
  52.             // rib //
  53.             /////////
  54.             
  55.             scope(
  56.                 // rotate so that rib does not point in same direction as the spine
  57.                 rotate( <0,1.570796,0> : <-2,-2,-2> : <2,2,2> ),
  58.                 // move away from spine slightly
  59.                 //forward( 0 : -3 : 3 ),
  60.                 // re-shape primitive
  61.                 eggVectorScale( <1,1,1> : <1,1,1> : <10,10,10> ),
  62.                 // determine primitive type
  63.                 egg( 0 : 0 : 10 ),
  64.                 lay,
  65.  
  66.                 // in this form the rib visually consists of a reflected sub-horn
  67.                 reflect( <1,1,-1> : <-1,-1,-1> : <1,1,1>,  
  68.                     ///////////////////////////
  69.                     // rib visual : sub horn //
  70.                     ///////////////////////////
  71.  
  72.                     ifElse( isMore( getScalarMem(1), 0 ),
  73.  
  74.                         ////////////////////////
  75.                         // sub-alternative #1 //
  76.                         ////////////////////////
  77.  
  78.                         join(
  79.                             // initialise material properties
  80.                             setColour( hsv<.5,.5,.75> : hsv<0,.2,.5> : hsv<.99999,.99999,.99999> ),
  81.                             setTexture( norder false:toggle ),
  82.                             setBitmap( norder 0 : 0 : 20 ),
  83.                             *setWrap( norder 0 : 0 : 2 ),
  84.  
  85.                             ///////////////
  86.                             // horn loop //
  87.                             ///////////////
  88.  
  89.                             repeat( 1 : 1 : 40,   // #sub-horn-segments
  90.                                 
  91.                                 // horn-segment code is made up of 2 distinct code blocks; the first block is executed
  92.                                 // within a new scope, called the "segment rib"; the second block is executed within
  93.                                 // the current scope and is called the "segment spine"
  94.                                 join(
  95.  
  96.                                     /////////////
  97.                                     // sub-rib //
  98.                                     /////////////
  99.  
  100.                                     // in this horn the rib visually consists of a single primtive
  101.                                     scope(
  102.                                         // rotate so that rib does not point in same direction as the spine
  103.                                         rotate( <0,1.570796,0> : <-2,-2,-2> : <2,2,2> ),
  104.                                         // move away from spine slightly
  105.                                         forward( 0 : -2 : 2 ),
  106.                                         // re-shape primitive
  107.                                         eggVectorScale( <1,1,1> : <.75,.75,.75> : <1.25,1.25,1.25> ),
  108.                                         // determine primitive type and lay an egg
  109.                                         egg( 0 : 0 : 10 ),
  110.                                         lay
  111.                                     ),
  112.  
  113.                                     ///////////////
  114.                                     // sub-spine //
  115.                                     ///////////////
  116.  
  117.                                     // updates the turtle state ready for the next segment
  118.                                     forward( .5 : -1 : 1 ),
  119.                                     scale( 1.05 : 1.01 : 1.1 ),
  120.                                     rotate( <0,0,0> : <-.2,-.2,-.2> : <.2,.2,.2> ),
  121.                                     moveHue( 0.03 : -0.08 : 0.08 ),
  122.                                     moveSat( 0.01 : -0.08 : 0.08 ),
  123.                                     moveVol( 0 : -0.2 : 0.2 ),
  124.                                     scale( 1 : 0.9 : 1.1 ),
  125.                                     moveRatio( 0 : -0.2 : 0.2 )
  126.                                 )
  127.                             )  // end sub-horn repeat loop
  128.                         ),  // end sub-horn-join block
  129.  
  130.                         ////////////////////////
  131.                         // sub-alternative #2 //
  132.                         ////////////////////////
  133.  
  134.                         join(
  135.  
  136.                             // initialise material properties
  137.                             setColour( hsv<.5,.5,.75> : hsv<0,.2,.5> : hsv<.99999,.99999,.99999> ),
  138.                             setTexture( norder false:toggle ),
  139.                             setBitmap( norder 0 : 0 : 20 ),
  140.                             *setWrap( norder 0 : 0 : 2 ),
  141.  
  142.                             ///////////////
  143.                             // horn loop //
  144.                             ///////////////
  145.  
  146.                             repeat( 1 : 1 : 40,   // #sub-horn-segments
  147.                                 
  148.                                 // horn-segment code is made up of 2 distinct code blocks; the first block is executed
  149.                                 // within a new scope, called the "segment rib"; the second block is executed within
  150.                                 // the current scope and is called the "segment spine"
  151.                                 join(
  152.  
  153.                                     /////////////
  154.                                     // sub-rib //
  155.                                     /////////////
  156.  
  157.                                     // in this horn the rib visually consists of a single primtive
  158.                                     scope(
  159.                                         // rotate so that rib does not point in same direction as the spine
  160.                                         rotate( <0,1.570796,0> : <-2,-2,-2> : <2,2,2> ),
  161.                                         // move away from spine slightly
  162.                                         forward( 0 : -2 : 2 ),
  163.                                         // re-shape primitive
  164.                                         eggVectorScale( <1,1,1> : <.75,.75,.75> : <1.25,1.25,1.25> ),
  165.                                         // determine primitive type and lay an egg
  166.                                         egg( 0 : 0 : 10 ),
  167.                                         lay
  168.                                     ),
  169.  
  170.                                     ///////////////
  171.                                     // sub-spine //
  172.                                     ///////////////
  173.  
  174.                                     // updates the turtle state ready for the next segment
  175.                                     forward( -.5 : -1 : 1 ),
  176.                                     scale( 1.05 : 0.8 : 1.2 ),
  177.                                     rotate( <0,0,0> : <-.2,-.2,-.2> : <.2,.2,.2> ),
  178.                                     moveHue( -0.03 : -0.08 : 0.08 ),
  179.                                     moveSat( 0.01 : -0.08 : 0.08 ),
  180.                                     moveVol( 0 : -0.2 : 0.2 ),
  181.                                     moveRatio( 0 : -0.2 : 0.2 )
  182.                                 )
  183.                             )  // end sub-horn repeat loop
  184.                         )  // end sub-horn-join block
  185.                     )  // end ifElse
  186.                 )  // end reflect
  187.             ), // end rib-scope
  188.  
  189.             ///////////
  190.             // spine //
  191.             ///////////
  192.  
  193.             // updates the turtle state ready for the next segment
  194.             forward( 1 : -1 : 1 ),
  195.             scale( 1.05 : 0.8 : 1.2 ),
  196.             noseUp( 0 : -.2 : .2 ),
  197.             moveHue( 0.01 : -0.08 : 0.08 ),
  198.             moveSat( 0.03 : -0.08 : 0.08 ),
  199.             moveVol( 0 : -0.2 : 0.2 ),
  200.             moveRatio( 0 : -0.05 : 0.05 )
  201.         )
  202.     )
  203. }
  204.  
  205.  
  206. // eof : ribHorn4.pop
  207.  
  208.